package com.example.controller;

import com.example.model.pojo.Answer;
import com.example.model.pojo.Result;
import com.example.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 27954
 * @Description TODO
 * @Date 2022/9/18 19:52
 */
@RestController
@RequestMapping("answer")
public class AnswerController {
    @Autowired
    private AnswerService answerService;
    @GetMapping("hot")
    public Result hotPage(Integer pageNum,Integer pageSize){
        Page<Answer> page=answerService.loadHotAnswerService(pageNum-1,pageSize);
        return new Result("200","success",page);
    }
}
